Skip to content

add various output options for different model capabilities#6

Merged
fccview merged 2 commits into
mainfrom
develop
Jul 1, 2026
Merged

add various output options for different model capabilities#6
fccview merged 2 commits into
mainfrom
develop

Conversation

@fccview

@fccview fccview commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

Summary by CodeRabbit

  • New Features

    • Search results now support configurable text display modes, including full results, breakdown-only, results-only, or no visible text.
    • Search output now more clearly separates plain-text results from structured data, with improved guidance for when to use additional page scraping.
  • Documentation

    • Updated README guidance for search output and added documentation for the new search text configuration option.
  • Bug Fixes

    • Improved default search output behavior and validation for invalid configuration values.
    • Refined test coverage to ensure search text modes render as expected.

@coderabbitai

coderabbitai Bot commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Warning

Review limit reached

@fccview, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 41 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 1e83209f-0c5e-4d6f-886d-af0378812fb8

📥 Commits

Reviewing files that changed from the base of the PR and between 39ae9f1 and 74fd2a4.

📒 Files selected for processing (4)
  • README.md
  • commands/handler_test.go
  • commands/search.go
  • tools/search.go
📝 Walkthrough

Walkthrough

Adds a DEGOOG_MCP_SEARCH_TEXT environment variable with four allowed modes (full, results, breakdown, none, defaulting to none) that controls what plain-text content the search MCP tool returns alongside structuredContent. The Config struct gains a SearchText field populated by a new readSearchText helper. The search handler picks up this field and routes output through a new searchVisibleContent/searchVisibleText pipeline replacing the prior single searchSummary function. SEARCH_DESC and SCRAPE_DESC tool descriptions are revised to reflect the visible-text vs. structuredContent distinction and updated scrape-trigger guidance. Tests and README are updated to match.

Possibly related PRs

  • degoog-org/mcp#1: Modifies searchHandler.handle flow and tool output/summary formatting in commands/search.go, directly preceding this PR's visible text rendering changes.
  • degoog-org/mcp#4: Refactors tools/search.go to support scrapeEnabled/no-scrape descriptions for the search tool, overlapping with this PR's SEARCH_DESC wording updates.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title is clearly related to the main change: adding configurable output modes for search/tool responses based on model capability.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch develop

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@commands/search.go`:
- Around line 113-124: The default handling in searchVisibleText is wrong: it
currently maps an empty SearchText mode to full output instead of the documented
none behavior. Update the mode switch in searchVisibleText so the
zero-value/unset case follows config.SEARCH_TEXT_NONE (and keep only the
explicit full mode rendering all sections), ensuring callers like newSearchH
with config.Config{} do not emit visible text unexpectedly.

In `@README.md`:
- Line 9: The README description for the search tool currently implies
plain-text results are always returned, but the default behavior is
structured-only unless operators opt in. Update the `search` bullet in the
documentation to say it can return model-readable plain-text results or
explicitly mention the `DEGOOG_MCP_SEARCH_TEXT` setting so the behavior is
presented as configurable rather than guaranteed.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 3a976cf7-baef-4194-a0fb-d9fe26d669f7

📥 Commits

Reviewing files that changed from the base of the PR and between 0df1e2f and 39ae9f1.

📒 Files selected for processing (7)
  • README.md
  • commands/handler_test.go
  • commands/search.go
  • internal/config/config.go
  • tests/config_test.go
  • tools/scrape.go
  • tools/search.go

Comment thread commands/search.go Outdated
Comment on lines +113 to +124
func searchVisibleText(out tools.SearchOutput, mode string) string {
switch mode {
case config.SEARCH_TEXT_NONE:
return ""
case config.SEARCH_TEXT_BREAKDOWN:
return strings.Join([]string{searchBreakdownLine(out), searchOutputExplanation()}, "\n\n")
case config.SEARCH_TEXT_RESULTS:
return strings.Join([]string{searchResultsText(out), searchScrapeGuidance()}, "\n\n")
case config.SEARCH_TEXT_FULL, "":
return strings.Join([]string{searchBreakdownLine(out), searchOutputExplanation(), searchResultsText(out), searchScrapeGuidance()}, "\n\n")
default:
return strings.Join([]string{searchBreakdownLine(out), searchOutputExplanation(), searchResultsText(out), searchScrapeGuidance()}, "\n\n")

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Honor the documented none default for unset SearchText.

searchVisibleText currently treats mode == "" as full, but the config contract for this PR says the default is none. Any caller that passes a zero-value config.Config{} into newSearchH will emit visible text unexpectedly instead of suppressing it.

Proposed fix
 func searchVisibleText(out tools.SearchOutput, mode string) string {
 	switch mode {
-	case config.SEARCH_TEXT_NONE:
+	case "", config.SEARCH_TEXT_NONE:
 		return ""
 	case config.SEARCH_TEXT_BREAKDOWN:
 		return strings.Join([]string{searchBreakdownLine(out), searchOutputExplanation()}, "\n\n")
 	case config.SEARCH_TEXT_RESULTS:
 		return strings.Join([]string{searchResultsText(out), searchScrapeGuidance()}, "\n\n")
-	case config.SEARCH_TEXT_FULL, "":
+	case config.SEARCH_TEXT_FULL:
 		return strings.Join([]string{searchBreakdownLine(out), searchOutputExplanation(), searchResultsText(out), searchScrapeGuidance()}, "\n\n")
 	default:
-		return strings.Join([]string{searchBreakdownLine(out), searchOutputExplanation(), searchResultsText(out), searchScrapeGuidance()}, "\n\n")
+		return ""
 	}
 }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
func searchVisibleText(out tools.SearchOutput, mode string) string {
switch mode {
case config.SEARCH_TEXT_NONE:
return ""
case config.SEARCH_TEXT_BREAKDOWN:
return strings.Join([]string{searchBreakdownLine(out), searchOutputExplanation()}, "\n\n")
case config.SEARCH_TEXT_RESULTS:
return strings.Join([]string{searchResultsText(out), searchScrapeGuidance()}, "\n\n")
case config.SEARCH_TEXT_FULL, "":
return strings.Join([]string{searchBreakdownLine(out), searchOutputExplanation(), searchResultsText(out), searchScrapeGuidance()}, "\n\n")
default:
return strings.Join([]string{searchBreakdownLine(out), searchOutputExplanation(), searchResultsText(out), searchScrapeGuidance()}, "\n\n")
func searchVisibleText(out tools.SearchOutput, mode string) string {
switch mode {
case "", config.SEARCH_TEXT_NONE:
return ""
case config.SEARCH_TEXT_BREAKDOWN:
return strings.Join([]string{searchBreakdownLine(out), searchOutputExplanation()}, "\n\n")
case config.SEARCH_TEXT_RESULTS:
return strings.Join([]string{searchResultsText(out), searchScrapeGuidance()}, "\n\n")
case config.SEARCH_TEXT_FULL:
return strings.Join([]string{searchBreakdownLine(out), searchOutputExplanation(), searchResultsText(out), searchScrapeGuidance()}, "\n\n")
default:
return ""
}
}
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@commands/search.go` around lines 113 - 124, The default handling in
searchVisibleText is wrong: it currently maps an empty SearchText mode to full
output instead of the documented none behavior. Update the mode switch in
searchVisibleText so the zero-value/unset case follows config.SEARCH_TEXT_NONE
(and keep only the explicit full mode rendering all sections), ensuring callers
like newSearchH with config.Config{} do not emit visible text unexpectedly.

Comment thread README.md
@fccview fccview merged commit 1a32f89 into main Jul 1, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants